package com.kakarote.admin.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.kakarote.admin.entity.PO.AdminApplyOrder;
import com.kakarote.core.servlet.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;

public interface AdminApplyOrderMapper extends BaseMapper<AdminApplyOrder> {

    /**
     * 根据id查询wk_admin_apply_order
     *
     * @param id:id
     * @return com.kakarote.admin.entity.PO.AdminApplyOrder
     */
    @Select("select *  from `wk_admin_apply_order` WHERE `id`=#{id} for update")
    AdminApplyOrder getByIdForUpdate(@Param("id") Serializable id);

    @InterceptorIgnore(tenantLine = "true")
    @Insert("INSERT INTO `wk_admin_apply_order` (id,name,year,amount,status,create_time,pay_time,pay_way,update_time,goods_id,goods_ids,close_time,contract,invoice,wx_code_url,msg,user_id,mobile) VALUES (#{order.id},#{order.name},#{order.year},#{order.amount},#{order.status},#{order.createTime},#{order.payTime},#{order.payWay},#{order.updateTime},#{order.goodsId},#{order.goodsIds},#{order.closeTime},#{order.contract},#{order.invoice},#{order.wxCodeUrl},#{order.msg},#{order.userId},#{order.mobile})")
    Integer saveOrder(@Param("order") AdminApplyOrder order);
}
